
#ifndef _MEMBER_BTREEITEM_H_
#define _MEMBER_BTREEITEM_H_

#include <BPainter>
#include <BFont>
#include <BScrollBar>
#include <BTreeWidget>
#include <BImage>
#include <BTreeItem>

#define item_member(item)		((member_BTreeItem*)((BTreeItem*)item)->_ptr)

namespace BWE
{
	class member_BTreeItem
	{
	public:
		member_BTreeItem(BTreeItem* treeItem);
		~member_BTreeItem();
		
		void attach(BTreeWidget* treeWidget);
		void detach(BTreeWidget* treeWidget);

		void dirtyTree();

		void adjust();
		void paint(BPainter& painter);
		
		BTreeItem*		boss;
		BTreeWidget*	tree;

		bool			expanded;
		bool			selected;

		Align			align;
		BString			text;
		BImageHolder	image;
		BImageHolder	arrowImage;
		BWidgetHolder	widget;
		BValue			value;

		bool			dirty;
		BRect			rect;
		int				indent;
		BSize			sizeHint;
		BSize			textSize;

		BRect			contentRect;
		BRect			arrowRect;
		BRect			imageRect;
		BRect			textRect;

		BTreeItem*				parent;
		BArray<BTreeItemHolder>	children;
	};
}
#endif